package com.fanbuchi.app.ins.service;

import com.fanbuchi.app.ins.api.API;
import com.fanbuchi.app.ins.filter.Filter;

import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by rabbit on 2016/3/21.
 */
public class BaseServcice {


    public static <T> T  createAPI(final Class<T> service) {
        T createAPI = API.retrofit.create(service);
       return createAPI;
    }


    public static Observable asyncService(Observable observable){
       return observable.subscribeOn(Schedulers.io())
                  .observeOn(AndroidSchedulers.mainThread())
                  ;
       // Filter.afterfliter(observable);
    }
}
